
#ifndef __KERNEL__
#  define __KERNEL__
#endif
#ifndef MODULE
#  define MODULE
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/tcp.h>
#include <linux/ip.h>
#include <net/ip.h>

extern int (*eeFunction02)(struct sk_buff *);

int DSCPmaker(struct sk_buff *skb)
{
    struct iphdr *iph;
    struct tcphdr *th;

    iph = skb->nh.iph;
    if(iph->protocol == IPPROTO_TCP) 
    {
        skb->h.raw = (unsigned char *)(skb->nh.raw + iph->ihl*4);
        th = skb->h.th;
        
        if((tcp_flag_word(th)&TCP_FLAG_ACK))
        {
            skb->nh.iph->tos=0xB8;
            ip_send_check(skb->nh.iph);
        }
    }
    return 0;
}
int init_module(void)
{
    printk("\neeFunction2: DSCP Maker install ok!\n");
    eeFunction02  = DSCPmaker;
    return 0;
}
void cleanup_module(void)
{
    eeFunction02 = 0;
    printk("\neeFunction2: DSCP Maker uninstall ok!\n");
}
MODULE_LICENSE("GPL");


